home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_gen / t4diblib.zip / ANIMATE3.F3_ / ANIMATE3.F3
Text File  |  1995-11-14  |  2KB  |  92 lines

  1. VERSION 2.00
  2. Begin Form Form1
  3.    Caption         =   "ANIMATE3"
  4.    ClientHeight    =   1692
  5.    ClientLeft      =   2628
  6.    ClientTop       =   2688
  7.    ClientWidth     =   2772
  8.    Height          =   2112
  9.    Left            =   2580
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   1692
  12.    ScaleWidth      =   2772
  13.    Top             =   2316
  14.    Width           =   2868
  15.    Begin T4DILIB dilib1
  16.       Caption         =   "dilib1"
  17.       ControlMode     =   0  'Lib -> PIC
  18.       Height          =   372
  19.       Left            =   1680
  20.       Top             =   1200
  21.       Visible         =   0   'False
  22.       Width           =   972
  23.    End
  24.    Begin CommandButton Command1
  25.       Caption         =   "&Quit"
  26.       Height          =   372
  27.       Left            =   120
  28.       TabIndex        =   0
  29.       Top             =   1200
  30.       Width           =   1452
  31.    End
  32.    Begin Image Image1
  33.       Height          =   372
  34.       Left            =   120
  35.       Stretch         =   -1  'True
  36.       Top             =   120
  37.       Width           =   972
  38.    End
  39. End
  40. Option Explicit
  41. Declare Function GetFreeSpace& Lib "kernel" (ByVal x%)
  42. Dim TimeIn!
  43. Dim Frames%
  44.  
  45. Sub Command1_Click ()
  46.  Terminate
  47. End Sub
  48.  
  49. Sub Form_Load ()
  50. Dim loopctr%, memctr%
  51. Dim imwidth!, imheight!, imhwratio!
  52.  top = (screen.Height - Height) / 2!
  53.  left = (screen.Width - Width) / 2!
  54.  dilib1.LibraryName = "bluespin.ilb"
  55.  dilib1.Action = IM_ACTION_OPENLIBRARY
  56.  Show
  57.  Form1.Refresh
  58.  TimeIn = Timer
  59.  For loopctr = 1 To 100
  60.   For memctr = 1 To dilib1.MemberCount
  61.    dilib1.MemberNumber = memctr
  62. 'Keep Image1.Width constant.
  63. 'Calculate how high image1 should be.
  64.    imwidth = dilib1.PixelWidth
  65.    imheight = dilib1.PixelHeight
  66.    imhwratio = imheight / imwidth
  67.    image1.Height = imhwratio * image1.Width
  68.    dilib1.Action = IM_ACTION_GETMEMBER
  69.    image1.Picture = dilib1.Picture
  70.    image1.Refresh
  71.    Frames = Frames + 1
  72.   Next memctr
  73.   DoEvents
  74.  Next loopctr
  75.  Terminate
  76. End Sub
  77.  
  78. Sub Form_Unload (Cancel As Integer)
  79.  End
  80. End Sub
  81.  
  82. Sub Terminate ()
  83. Dim TimeOut!, TimeElapsed!, fps!
  84.  TimeOut = Timer
  85.  TimeElapsed = TimeOut - TimeIn
  86.  fps = Frames
  87.  fps = Frames / TimeElapsed
  88.  MsgBox Trim$(Str$(fps)) + " frames per second."
  89.  End
  90. End Sub
  91.  
  92.